package top.malaoshi.webmvc.exception;

import org.springframework.http.HttpStatus;

import javax.servlet.ServletException;

/**
 * 不支持请求方法的异常
 * 如：方法上使用 PostMapping注解，但发送 get 请求，就会抛出此异常
 */
public class HttpRequestMethodNotSupportedException extends ServletException {
    private int code = HttpStatus.METHOD_NOT_ALLOWED.value();
    public HttpRequestMethodNotSupportedException(String message) {
        super(message);
    }

    public int getCode() {
        return code;
    }
}
